﻿using System;
using System.Collections.Generic;
using System.Linq;
using Engine.Serialization;

namespace Engine.OldSerialization {
    [HumanReadableConverter(typeof(List<string>))]
    public class ListStringHumanReadableConverter : IHumanReadableConverter {
        public string ConvertToString(object value) {
            List<string> list = (List<string>)value;
            return HumanReadableConverter.ValuesListToString(';', list.ToArray());
        }

        public object ConvertFromString(Type type, string data) => HumanReadableConverter.ValuesListFromString<string>(';', data).ToList();
    }
}